LoginCtrl = {};
local this = LoginCtrl;

local message;
local transform;
local gameObject;

--构建函数--
function LoginCtrl.New()
    logWarn("LoginCtrl.New--->>");
    return this;
end

function LoginCtrl.Awake()
    logWarn("LoginCtrl.Awake--->>");
    panelMgr:CreatePanel('Login', this.OnCreate);
end

--启动事件--
function LoginCtrl.OnCreate(obj)
    gameObject = obj;
    transform = obj.transform;

    message = gameObject:GetComponent('LuaBehaviour');

    UIEventEx.AddButtonClick(LoginPanel.loginButton, function ()
        log("你点击了登录");
    end);
    UIEventEx.AddToggle(LoginPanel.savePWdToggle, function (go, select)
        log("记住密码：" .. tostring(select));
    end)
    UIEventEx.AddInputFieldEndEditHandle(LoginPanel.accountInput , function (account)
        log("账号输入：" .. account);
    end)



    logWarn("Start lua--->>"..gameObject.name);
end

--单击事件--
function LoginCtrl.OnClick(go)
    destroy(gameObject);
end

--关闭事件--
function LoginCtrl.Close()
    panelMgr:ClosePanel(CtrlNames.Message);
end